#ifndef DESKTOPICON_H
#define DESKTOPICON_H

#include <QGraphicsItem>
#include <QFontDatabase>
#include <QLabel>

class DesktopIcon : public QGraphicsItem
{
public:
    DesktopIcon(const bool& is_dir, const QImage& icon, const QString& file_name, QGraphicsItem *parent = nullptr);
    DesktopIcon(const DesktopIcon& other);
    DesktopIcon& operator=(const DesktopIcon& rhs);

protected:
    QRectF boundingRect() const;
    void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget *widget);

private:
    void InsertLine();

private:
    bool is_dir_;
    double width_ = 75;
    double height_ = 98;

    QImage icon_;
    QString file_name_;
    QFont font_;
    QLabel text_label_;
};

#endif // DESKTOPICON_H
